package com.igeek.dvd;

/**
 * 租赁系统
 */
public class RentSys {

    /**
     * 租赁系统处理业务逻辑
     */
    private RentService rentService = new RentService();

    public void login(){
        System.out.println("请输入用户名：");
        String username ="";
        System.out.println("请输入密码：");
        String password ="";

        User u = rentService.login(username,password);

        if(u.isAdmin()){
            //是管理员
            AdminRentSys adminRentSys = new AdminRentSys();
            adminRentSys.start();

        }else{
            //普通用户
            UserRentSys userRentSys = new UserRentSys();
            userRentSys.start(u);
        }

    }

    public static void main(String[] args) {
        RentSys rentSys = new RentSys();
        rentSys.login();
    }
}
